package com.olt.domain.oltCenter.problem;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.List;

@Getter
@Setter
public  class SelectProblem extends ProblemAbstract {

    HashMap<Integer,String> selects;

    List<Integer> ans;

    Boolean only;

    @Override
    public void deleteAns() {
        ans=null;
    }

    @Override
    public Double getScore(Integer score, JSONObject jsonObject) {
        List<Integer> res=jsonObject.getJSONArray("res").toJavaList(Integer.class);
        for(var i :ans){
            if(!res.contains(i)){
                return 0.0;
            }
        }
        return score*1.0;
    }
}


